#include <wx/wx.h>#include "dialog.h"

class MyFrame: public wxFrame{
private:
	wxButton *_btn;
	wxDialog *_dlg;

public:
	MyFrame(wxWindow *parent)
	: wxFrame(parent, -1, _T("Test of Dialog")), _btn(NULL), _dlg(NULL){
		_btn = new wxButton(this, BUTTON, _T("Btn"), wxPoint(5,5), wxSize(30,10));
	}

	void OnBtnClick(wxCommandEvent &event){
		_dlg = new MyDialog(this);
		_dlg->ShowModal();		delete _dlg;
	}

protected:
	enum{
		BUTTON,
	};

	DECLARE_EVENT_TABLE()
};

BEGIN_EVENT_TABLE(MyFrame, wxFrame)
	EVT_BUTTON(BUTTON, MyFrame::OnBtnClick)
END_EVENT_TABLE()

class MyApp: public wxApp{
public:
	virtual bool OnInit(){
		MyFrame *fm = new MyFrame(NULL);
		fm->Show();
		return true;
	}
};

IMPLEMENT_APP(MyApp)
